\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{stmaryrd}
\textheight=10in
\pagestyle{empty}
\usepackage[margin=1.5cm]{geometry}
\usepackage{float}

\begin{document}
\textbf{Rohith Menon (107666079)}
\section{K(3) Nearest neighbours}
The following images show the test image and the nearest three images (neighbours) in decending order of distance from the test image.
\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/0_0.png} &
\includegraphics[width=1in]{working_dir/0_1.png} &
\includegraphics[width=1in]{working_dir/0_2.png} &
\includegraphics[width=1in]{working_dir/0_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/1_0.png} &
\includegraphics[width=1in]{working_dir/1_1.png} &
\includegraphics[width=1in]{working_dir/1_2.png} &
\includegraphics[width=1in]{working_dir/1_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/2_0.png} &
\includegraphics[width=1in]{working_dir/2_1.png} &
\includegraphics[width=1in]{working_dir/2_2.png} &
\includegraphics[width=1in]{working_dir/2_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/3_0.png} &
\includegraphics[width=1in]{working_dir/3_1.png} &
\includegraphics[width=1in]{working_dir/3_2.png} &
\includegraphics[width=1in]{working_dir/3_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/4_0.png} &
\includegraphics[width=1in]{working_dir/4_1.png} &
\includegraphics[width=1in]{working_dir/4_2.png} &
\includegraphics[width=1in]{working_dir/4_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/5_0.png} &
\includegraphics[width=1in]{working_dir/5_1.png} &
\includegraphics[width=1in]{working_dir/5_2.png} &
\includegraphics[width=1in]{working_dir/5_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/6_0.png} &
\includegraphics[width=1in]{working_dir/6_1.png} &
\includegraphics[width=1in]{working_dir/6_2.png} &
\includegraphics[width=1in]{working_dir/6_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/7_0.png} &
\includegraphics[width=1in]{working_dir/7_1.png} &
\includegraphics[width=1in]{working_dir/7_2.png} &
\includegraphics[width=1in]{working_dir/7_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/8_0.png} &
\includegraphics[width=1in]{working_dir/8_1.png} &
\includegraphics[width=1in]{working_dir/8_2.png} &
\includegraphics[width=1in]{working_dir/8_3.png}
\end{array}$
\end{center}
\end{figure}

\begin{figure}[H]
\begin{center}$
\begin{array}{cccc}
\includegraphics[width=1in]{working_dir/9_0.png} &
\includegraphics[width=1in]{working_dir/9_1.png} &
\includegraphics[width=1in]{working_dir/9_2.png} &
\includegraphics[width=1in]{working_dir/9_3.png}
\end{array}$
\end{center}
\end{figure}

\section{Decision tree based on Information gain}
\begin{verbatim}
VISIBILITY == yes
    ERROR == XL
        Prediction: "noauto"
    ERROR == LX
        Prediction: "noauto"
    ERROR == MM
        STABILITY == stab
            SIGN == pp
                MAGNITUDE == low
                    Prediction: "auto"
                MAGNITUDE == medium
                    Prediction: "auto"
                MAGNITUDE == strong
                    WIND == head
                        Prediction: "noauto"
                    WIND == tail
                        Prediction: "auto"
                MAGNITUDE == outofrange
                    Prediction: "noauto"
            SIGN == nn
                Prediction: "noauto"
        STABILITY == xstab
            Prediction: "noauto"
    ERROR == SS
        STABILITY == stab
            MAGNITUDE == low
                Prediction: "auto"
            MAGNITUDE == medium
                Prediction: "auto"
            MAGNITUDE == strong
                Prediction: "auto"
            MAGNITUDE == outofrange
                Prediction: "noauto"
        STABILITY == xstab
            Prediction: "noauto"
VISIBILITY == no
    Prediction: "auto"
\end{verbatim}
\section{Decision tree based on Gain ratio}
\begin{verbatim}
VISIBILITY == yes
    STABILITY == stab
        ERROR == XL
            Prediction: "noauto"
        ERROR == LX
            Prediction: "noauto"
        ERROR == MM
            SIGN == pp
                MAGNITUDE == low
                    Prediction: "auto"
                MAGNITUDE == medium
                    Prediction: "auto"
                MAGNITUDE == strong
                    WIND == head
                        Prediction: "noauto"
                    WIND == tail
                        Prediction: "auto"
                MAGNITUDE == outofrange
                    Prediction: "noauto"
            SIGN == nn
                Prediction: "noauto"
        ERROR == SS
            MAGNITUDE == low
                Prediction: "auto"
            MAGNITUDE == medium
                Prediction: "auto"
            MAGNITUDE == strong
                Prediction: "auto"
            MAGNITUDE == outofrange
                Prediction: "noauto"
    STABILITY == xstab
        Prediction: "noauto"
VISIBILITY == no
    Prediction: "auto"
\end{verbatim}
There is a difference between the tree built from information gain and gain ratio. The one created from information gain has error as the second level in the tree. But with gain ratio, since error has more values, stability becomes a more important attribute and hence is at the second level for gain ratio.
\end{document}

